﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DreametryMIS
{
    public partial class frmFloatingWorkFlow: Form
    {
        public frmFloatingWorkFlow()
        {
            InitializeComponent();
        }

        private void frmFloatingWorkFlow_Load(object sender, EventArgs e)
        {
            Rectangle workingArea = Screen.GetWorkingArea(this);
            this.Location = new Point(workingArea.Right - Size.Width,workingArea.Bottom - Size.Height);
            this.flowControl1.getAll();
            
        }

        private void flowControl1_Load(object sender, EventArgs e)
        {

        }

        private NotifyIcon notifyIcon1;
        private IContainer components;
        private const int CP_NOCLOSE_BUTTON = 0x200;
        protected override CreateParams CreateParams
        {
            get
            {
                CreateParams myCp = base.CreateParams;
                myCp.ClassStyle = myCp.ClassStyle | CP_NOCLOSE_BUTTON;
                return myCp;
            }
        }

        private void showToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void hideToolStripMenuItem_Click(object sender, EventArgs e)
        {
           
        }

        private void notifyIcon1_DoubleClick(object sender, EventArgs e)
        {
            Show();
            WindowState = FormWindowState.Normal;
        }

        private void frmFloatingWorkFlow_Resize(object sender, EventArgs e)
        {
            if (FormWindowState.Minimized == WindowState)
                Hide();
        }

        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(frmFloatingWorkFlow));
            this.flowControl1 = new DreametryMIS.FlowControl();
            this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
            this.SuspendLayout();
            // 
            // flowControl1
            // 
            this.flowControl1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.flowControl1.Location = new System.Drawing.Point(0, 0);
            this.flowControl1.Name = "flowControl1";
            this.flowControl1.Size = new System.Drawing.Size(292, 273);
            this.flowControl1.TabIndex = 0;
            // 
            // notifyIcon1
            // 
            this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
            this.notifyIcon1.Text = "Task Created";
            this.notifyIcon1.Visible = true;
            this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick_1);
            // 
            // frmFloatingWorkFlow
            // 
            this.ClientSize = new System.Drawing.Size(292, 273);
            this.Controls.Add(this.flowControl1);
            this.Name = "frmFloatingWorkFlow";
            this.TopMost = true;
            this.Load += new System.EventHandler(this.frmFloatingWorkFlow_Load_1);
            this.Resize += new System.EventHandler(this.frmFloatingWorkFlow_Resize_1);
            this.ResumeLayout(false);

        }

        private FlowControl flowControl1;

        private void frmFloatingWorkFlow_Load_1(object sender, EventArgs e)
        {
            Rectangle workingArea = Screen.GetWorkingArea(this);
            this.Location = new Point(workingArea.Right - Size.Width,
                                      workingArea.Bottom - Size.Height);
        }

        private void notifyIcon1_DoubleClick_1(object sender, EventArgs e)
        {
            Show();
            WindowState = FormWindowState.Normal;
        }

        private void frmFloatingWorkFlow_Resize_1(object sender, EventArgs e)
        {
            if (FormWindowState.Minimized == WindowState)
                Hide();
        }
    }
}
